<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title></title>
        <script src="../vue.js" type="text/javascript" charset="utf-8"></script>
    </head>
    <body>
        <div id="app">
            <!--在 v-for 里使用数组-->
            <ul id="example-1">
                <li v-for="item,index in items" :key="index">
                    {{index}} --- {{ item.message }}
                </li>
            </ul>
            <!--在 v-for 里使用对象-->
            <ul id="v-for-object" class="demo">
                <li v-for="value,key,index in object" :key="key">
                    {{index}} --- {{key}} --- {{ value }}
                </li>
            </ul>
        </div>
        <script type="text/javascript">
            var app = new Vue({
                el: '#app',
                data: {
                    items: [
                        { message: 'Foo' },
                        { message: 'Bar' }
                    ],
                    object: {
                        title: 'How to do lists in Vue',
                        author: 'Jane Doe',
                        publishedAt: '2016-04-10'
                    }
                }
            })
        </script>
        <style type="text/css">
        </style>
    </body>
</html>